Wireless sensor network and sampling rate allocation method thereof

ABSTRACT

A sampling rate allocation method for a wireless sensor network is provided. In this method, a distributed computing method is adopted to allow each node to calculate and obtain its decision table and energy table and upload its energy table to its parent node, and finally, the number of samples to be provided by all the child nodes is determined according to the decision table of the root node and a total sample number. Compared to the conventional techniques, the present invention provides a wireless sensor network which has longer life time and can meet the requirements to both the total number of samples and the fairness.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of Taiwan application serial no. 97112699, filed on Apr. 8, 2008. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of specification.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention generally relates to a wireless sensor network and a sampling rate allocation method thereof, in particular, to a wireless sensor network which has long life time and meets the requirements to both total sample number and fairness, and to a sampling rate allocation method thereof.

2. Description of Related Art

A wireless sensor network is composed of a plurality of wireless sensors, and which can be used for environment monitoring by periodically sensing various samples (for example, temperature, humidity, sound, radio frequency, and atmospheric pressure) via these wireless sensors. The number of samples sensed by the wireless sensors in a specific time interval is referred as sampling rate. In addition, besides being applied to environment monitoring, a wireless sensor network may also be applied to various aspects in our daily life or industrial processes, such as speech recognition, object localization, and system modeling etc.

FIG. 1 is a schematic diagram of a wireless sensor network 10. Referring to FIG. 1, the wireless sensor network 10 includes a plurality of nodes 100, 101, . . . , 107 and a host 108, wherein the nodes 100, 101, . . . , 107 and the host 108 are connected to each other and communicate through radio wave or infrared light so as to send sensed samples and parameters for allocating the sampling rate. The nodes 100, 101, . . . , 107 and the host 108 may have sensors for obtaining samples; however, some of the nodes 100, 101, . . . , 107 or the host 108 may have no sensor but simply receive and send samples (P.S. the host 108 does not send samples). The nodes 100, 101, . . . , 107 of the wireless sensor network 10 may be wireless communication units with sensors, and the host 108 may be referred as a root node. The host 108 receives and analyzes samples sensed by each of the nodes 100, 101, . . . , 107.

The quality of samples sensed by the wireless sensor network 10 is related to the total number of samples and the source of the samples. Generally speaking, to ensure the reliability of the samples sensed by the wireless sensor network 10, the total number of samples in a specific time interval is increased and different sampling rates are allocated regarding to the significances of different nodes, so as to meet the requirements to both total sample number and fairness. However, an over-large total sample number won't increase the quality of the sensed samples drastically. To truthfully reconstruct the monitored phenomenon, the sampling rate of the wireless sensor network must be at least twice the highest frequency of the original signal, according to the Nyquist-Shannon sampling theorem (Refer to A. J. Jerri, “The Shannon Sampling Sheorem—Its Various Extensions and Applications: A Tutorial Review.”, Proceedings of the IEEE, 65(11):1565-1596, 1977.). Taking a sound capturing system as an example, the quality of the samples is not increased obviously when the total number of samples is about 3000 samples per second.

The life time of the wireless sensor network 10 refers to the time when the energy of a particular node (one of the nodes 101˜107) is used up, and the monitored phenomenon cannot be reconstructed. Generally speaking, the sampling rate of the node is related to the life time of the wireless sensor network. This is because that the energy of a node is consumed whenever the node senses, sends, or receives a sample. Accordingly, the more samples the node senses, sends, or receives, the more energy of this node will be consumed, and which will shorten the life time of the entire wireless sensor network 10. Thus, the higher sampling rate a node has, the shorter the life time of the node is. The sampling rate of a node is increased along with the total number of samples. As a result, over sampling cannot increase the quality and reliability of the samples; instead, additional energy is consumed and the life time of the wireless sensor network 10 is even shortened.

Several sampling rate allocation methods for wireless sensor networks have been disclosed in U.S. Patent No. 20060206857, U.S. Patent No. 20070058664, U.S. Pat. No. 7,002,501, European Patent. No. 20050250440, and some other articles. According to these methods, a host is allowed to receive the most samples before the energy of a node is used up first. However, in these methods, the samples may all come from some particular nodes and induce bias in data analysis. According to these methods, nodes having more energy are used for sensing more samples so that the life time of the wireless sensor network can be prolonged. However, in the worst case, all the samples may come from the same node, and since the samples obtained from the same node cannot represent the characteristic of the entire network, analysis error may be caused. A host should be able to receive samples from different nodes so as to avoid bias in data analysis.

Articles for providing foregoing methods include: [1] J. H. Chang and L. Tassiulas, “Maximum lifetime routing in wireless sensor networks,” IEEE Trans. on Networking., vol. 12, no. 4, pp. 609-619, August 2004. [2] J. Park and S. Sahni, “An Online Heuristic for Maximum Lifetime Routing in Wireless Sensor Netzvorks,” IEEE/ACM Transactions on Networking, 12(4):609-619, 2004. [3] K. Kar, M. Kodialam, T. V. Lakshman, and L. Tassiulas., “Routing for Network Capacity Maximization in Energy-constrained Ad-hoc Networks,” In INFOCOM '03: Twenty-Second Annual Joint Conference of the IEEE computer and Communications Societies, pages 673-681. IEEE Press, 2003. [4] Madan, R. Lall, S., “Distributed Algorithms for Maximum Lifetime Routing in Wireless Sensor Networks,” IEEE Transaction on Wireless Communications, 5(8):2185-2193, 2006. [5] A. Sankar and Z. Liu., “Maximum Lifetime Routing in Wireless Ad-Hoc Networks,” In INFOCOM '04: Twenty-Third Annual Joint Conference of the IEEE computer and Communications Societies, pages 1089-1097. IEEE Press, 2004.

In addition, another type of sampling rate allocation methods is disclosed in some other articles. According to these methods, a utility function is allocated to each node, wherein the value of the utility function increases along with the sampling rate of the node, and the increment thereof is reduced along with the increasing of the sampling rate. In these methods, the sampling rate of each node is allocated such that the total value of the utility functions of all these nodes can be maximized before a node runs out of its energy. Through these methods, the problem of lack of fairness in foregoing patents and articles can be resolved; however, a host may not be able to receive enough number of samples, namely, the requirement of total sample number cannot be met.

Articles for providing foregoing methods include: [1] Y. Cui, Y. Xue, and K. Nahrstedt, “A Utility-based Distributed Maximum Lifetime Routing Algorithm for Wireless Networks,” in IEEE Transactions on Vehicular Technology, 55(3):797-805, 2006. [2] Y. T. Hou, Y. Shi, and H. D. Sherali, “Rate allocation in wireless sensor networks with network lifetime requirement,” in Proceedings of ACM International Symposium on Mobile Ad Hoc Networking and Computing (MobiHoc), pp. 67-77, May 24-26, 2004, Tokyo, Japan. [3] V. Srinivasan, C. F. Chiasserini, P. Nuggehalli, and R. R. Rao., “Optimal Rate Allocation for Energy Efficient Multipath Routing in Ad Hoc Wireless Net-works,” IEEE Transactions on Wireless Communications, Vol. 3, May 2004. [4] J. H. Zhu, Shan Chen, B. Bensaou, and K. L. Hung, “Tradeoff between Lifetime and Rate Allocation in Wireless Sensor Networks: A Cross Layer Approach,” in IEEE INFOCOM 2007, May 2007.

In short, even though the sampling rate allocation methods disclosed in foregoing patents and articles can prolong the life time of the entire wireless sensor network, they cannot meet the quantity and fairness requirements. In addition, the collected samples may not be able to reconstruct the monitored phenomenon.

SUMMARY OF THE INVENTION

Accordingly, the present invention is directed to a wireless sensor network and a sampling rate allocation method thereof. In the sampling rate allocation method of the wireless sensor network, a distributed computing method is adopted so that the wireless sensor network in tree topology can have prolonged life time and can meet both the quantity and fairness requirements.

The present invention provides a wireless sensor network including a root node, at least one internal node, and a plurality of leaf nodes. An internal node is a node having child nodes in the wireless sensor network, so it is not a leaf node. The root node sends a total sample number to the internal node and the leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time. Each leaf node calculates its remaining energy thereof after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the internal node. The internal node generates a second calculation result and a third calculation results based on these first calculation results and uploads the second calculation result and the third calculation result to the root node. The root node generates a fourth calculation result and a fifth calculation result based on the second calculation result. After that, the root node determines the number of samples to be sent by the internal node to the root node within the specific time according to the fifth calculation result and the total number of samples. Finally, the internal node determines the number of samples to be sensed by the internal node and the leaf nodes within the specific time according to the number of samples to be sent to the root node and the third calculation result.

According to an embodiment of the present invention, the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the internal node, and the fourth calculation result and the fifth calculation result are respectively an energy table and a decision table of the root node.

The present invention provides a wireless sensor network including a root node and a plurality of leaf nodes. The root node sends a total sample number to the leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time. Each leaf node calculates its remaining energy thereof after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the root node. The root node generates a second calculation result and a third calculation result based on these first calculation results. After that, the root node determines the number of samples to be sensed by the leaf nodes within the specific time according to the third calculation result and the total number of samples.

According to an embodiment of the present invention, the first calculation results are energy tables of the leaf nodes, and the second calculation result and the third calculation result are respectively an energy table and a decision table of the root node.

The present invention provides a sampling rate allocation method, wherein the sampling rate allocation method is suitable for a wireless sensor network in tree topology. The wireless sensor network includes a root node, at least one internal node, and a plurality of leaf nodes. Steps of the method are described as follows. First, the root node sends a total sample number to the internal node and each of the leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time. Then, each leaf node calculates its remaining energy thereof after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the internal node. Next, the internal node generates a second calculation result and a third calculation result based on the first calculation results and uploads the second calculation result to the root node. After that, the root node generates a fourth calculation result and a fifth calculation result based on the second calculation result. Next, the root node determines the number of samples to be sent by the internal node to the root node within the specific time according to the fifth calculation result and the total number of samples. Finally, the internal node determines the number of samples to be sensed by the internal node and the leaf nodes within the specific time according to the number of samples to be sent to the root node and the third calculation result.

According to an embodiment of the present invention, the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the internal node, and the fourth calculation result and the fifth calculation result are respectively an energy table and a decision table of the root node. The decision table of the root node records the mapping between the total number of samples and the number of samples to be provided by the internal node to the root node, and the decision table of the internal node records the mapping between the number of samples to be uploaded by the internal node to the root node within the specific time and the number of samples to be sensed by the internal node and the leaf nodes.

The present invention provides a sampling rate allocation method, wherein the sampling rate allocation method is suitable for a wireless sensor network in tree topology. The wireless sensor network includes a root node and a plurality of leaf nodes. Steps of the method are described as follows. First, the root node sends a total sample number to each of the leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time. Next, Each leaf node calculates its remaining energy thereof after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the root node. Then, the root node generates a second calculation result and a third calculation result based on the first calculation results. Finally, the root node determines the number of samples to be sensed by the leaf nodes within the specific time according to the third calculation result and the total number of samples.

According to an embodiment of the present invention, the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the root node, and the decision table of the root node records the mapping between the total number of samples and the number of samples to be sensed by the leaf nodes.

The present invention provides a wireless sensor network and a sampling rate allocation method thereof, wherein a distributed computing method is adopted so that the wireless sensor network in tree topology can prolong the network life time and meet both the quantity and fairness requirements. Thereby, both the cost for replacing node batteries and the volume of the batteries (for example, solar cells) can be reduced.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

FIG. 1 is a schematic diagram of a wireless sensor network 10.

FIG. 2 is a schematic diagram of a wireless sensor network 30 in tree topology.

FIG. 3 is a schematic diagram of a wireless sensor network 50 in tree topology.

FIG. 4 is a flowchart of a sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention.

FIG. 5 is a flowchart of a leaf node algorithm in a sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention.

FIG. 6 is a flowchart of a root node algorithm or an internal node algorithm in a sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention.

FIG. 7 is a schematic diagram of a wireless sensor network 80 in tree topology.

FIG. 8 is a parameter table of nodes S₀˜S₇ in FIG. 7.

FIG. 9 is a conceptual diagram illustrating the correction of an energy table E₅ and a decision table D₅.

FIG. 10 is a schematic diagram of a wireless sensor network 60 in tree topology.

DESCRIPTION OF THE EMBODIMENTS

Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.

The present invention provides a wireless sensor network and a sampling rate allocation method thereof. In the sampling rate allocation method, a sampling rate is allocated to each node in the wireless sensor network, and the wireless sensor network has longer life time and can meet both the quantity and fairness requirements.

[System Model of Wireless Sensor Network]

FIG. 2 is a schematic diagram of a wireless sensor network 30 in tree topology. Referring to FIG. 2, the wireless sensor network 30 includes a plurality of nodes 300, 301, . . . , 306 and a host 307. The nodes 300, 301, and 304 are leaf nodes in the tree topology, and the leaf nodes 300, 301, and 304 respectively have a sensor. The other nodes 302, 303, 305, and 306 are internal nodes, and the internal nodes 302, 303, 305, and 306 may have sensors or may have no sensor but only used for sending and receiving data. The nodes having sensors are referred as source nodes and which can be used for capturing samples (for example, humidity, temperature, pressure, and radio frequency etc) required by the host 307. The host 307 is the root node in the tree topology and which is used for receiving data from each node and analyzing the samples received from each node.

[Definition of Notations]

Herein, a critical node is defined as the node having the least energy among all the nodes in the wireless sensor network, and the energy thereof is referred as critical energy. The root node is denoted as S₀, and the other nodes are respectively denoted as S₁, S₂, . . . , and S_(n). The transmission energy consumed for sending a sample from the node S_(i) to the node S_(j) is denoted as a_(i,j), the receiving energy consumed by the node S_(i) for receiving a sample is denoted as β_(i), the sensing energy consumed by the node S_(i) for sensing a sample is denoted as γ_(i), the total number of samples required by the root node S₀ in a specific time interval is denoted as R. and sampling rate sampling rate x_(i) represents the number of samples sensed by the node S_(i) within a specific interval T. The sampling rate of each node S_(i) is limited in the range of l_(i) and u_(i), representing x_(i)'s minimum and maximum sampling rates. Because the specific interval T has a fixed value in embodiments of the present invention, the number of samples sensed by the node S_(i) can be considered as the sampling rate x_(i) in following description.

[Problem to be Resolved]

Within the specific interval T, the remaining energy of the node S_(i) is denoted as e_(i)′ after the root node S₀ obtains R samples. The method for calculating the remaining energy of the node S_(i) is:

$e_{i}^{\prime} = {e_{i} - {\gamma_{i} \times x_{i}} - {\sum\limits_{{j = 0},{j \neq i}}^{n}{\alpha_{i,j} \times z_{i,j}}} - {\beta_{i} \times {\sum\limits_{{k = 1},{k \neq i}}^{n}z_{k,i}}}}$

wherein e_(i) represents the original energy of the node S_(i) before the node S_(i) starts to sense samples, γ_(i)×x_(i) represents the consumed energy of the node S_(i) after the node S_(i) has sensed x_(i) samples, z_(i,j) represents the number of samples sent by the node S_(i) to the node

$S_{j},{\sum\limits_{{j = 0},{j \neq i}}^{n}{\alpha_{i,j} \times z_{i,j}}}$

represents the energy consumed by the node S_(i) for sending the samples, and

$\beta_{i} \times {\sum\limits_{{k = 1},{k \neq i}}^{n}z_{k,i}}$

represents the energy consumed by the node S_(i) for receiving samples. In addition, the number of samples sent by the node S_(i) is equal to the sum of the number of samples sensed by the node S_(i) and the number of samples received by the node S_(i). Thus,

${{x_{i} + {\sum\limits_{{k = 1},{k \neq i}}^{n}z_{k,i}}} = {\sum\limits_{{j = 0},{j \neq i}}^{n}{z_{i,j}.}}}\mspace{40mu}$

As defined above, the critical energy is the least one among the remaining energies e₁′, e₂′, . . . , and e_(n)′. Thus, to prolong the life time of the entire wireless sensor network, the sampling rate x_(i) has to be allocated appropriately so that the entire wireless sensor network can have the maximum critical energy. Foregoing issue can be expressed as:

${Maximize}\mspace{14mu} {\min\limits_{{i = 1},2,\ldots \mspace{14mu},n}\; e_{i}^{\prime}}$ ${{subject}\mspace{14mu} {to}\mspace{11mu} {\sum\limits_{i = 1}^{n}x_{i}}} = R$ $\begin{matrix} {\; \begin{matrix} {{x_{i} + {\sum\limits_{{k = 1},{k \neq i}}^{n}z_{k,i}}} = {\sum\limits_{{j = 0},{j \neq i}}^{n}z_{i,j}}} & {i,{j = 0},1,2,\ldots \mspace{14mu},n} \\ {x_{l,i} \leq x_{i} \leq x_{u,i}} & {{i = 0},1,2,\ldots \mspace{14mu},n} \\ {{e_{i}^{\prime} \geq 0},{z_{j,i} \geq 0}} & {i,{j = 0},1,2,\ldots \mspace{14mu},n} \end{matrix}} & \; & \; \end{matrix}$

Accordingly, the essence of the problem is to determine the sampling rate x_(i) of the node S_(i) and the flow z_(i,j) and z_(k,i) of each node so as to have the maximum critical energy after the root node S₀ obtains R samples.

Those having ordinary knowledge in the art should be able to list all the combinations of the sampling rate x_(i) and the remaining energy e_(i)′ of the node S_(i) and find out the combinations which meet the requirements of both the total number of samples R and fairness, and furthermore, find out a combination among foregoing combinations which allows the wireless sensor network to have the longest life time. Such a method is very intuitive; however, it may require significant computation time to find out the optimal solution in large scale wireless sensor networks.

To resolve foregoing problem, in the sampling rate allocation method provided by the present invention, a distributed computing method is adopted to reduce the complexity of the calculation, and the optimal sampling rate x_(i) of each node S_(i) is obtained through table look-up.

[Definition of Energy Table and Decision Table]

As described above, in embodiments of the present invention, the sampling rate x_(i) of each node S_(i) is allocated through table look-up, and the concepts of energy table and decision table are defined herein. Each node records an energy table and a decision table besides that each leaf node only records an energy table.

Herein E_(i) and D_(i) are used for representing the energy table and the decision table of the node S_(i). The energy table E_(i) has R+1 rows, and each of the rows has a field, wherein the fields are denoted as E_(i)[0]˜E_(i)[R]. The decision table D_(i) has R+1 rows, and each of the rows has y+1 fields, wherein y represents the number of child nodes of the node S_(i), and E_(i)[j] is defined as the critical energy among S_(i) and its sub-tree network after S_(i) sends out j samples. In addition, some of the samples provided by the node S_(i) within a specific time are from the child nodes of the node S_(i) while some other samples provided by the node S_(i) within the specific time are sensed by the node S_(i). Thus, decision table D_(i)[g,j] is used for representing the number of samples provided by the j^(th) child node of the node S_(i) when the node S_(i) provides g samples to its parent node within the specific time, and here the node S_(i) itself is considered the 0^(th) child node of the node S_(i). Accordingly, when the node S_(i) provides g samples to its parent node, the number of samples to be sensed by the node S_(i) is D_(i) [g,0], and the numbers of samples to be provided by the child nodes thereof are respectively D_(i)[g,1], D_(i)[g,2], D_(i)[g,3], . . . , and D_(i)[g,y], wherein D_(i)[g,j] meets the expression D_(i)[g,0]+D_(i)[g,1]+D_(i)[g,2]+ . . . +D_(i)[g,y]=g. Further, since a leaf node has no child node, it only records an energy table.

EXAMPLE 1

The foregoing method for allocating a sampling rate by using the energy table and the decision table for a wireless sensor network will be described below with reference to an example. However, this example is not intended for limiting the scope of the present invention.

FIG. 3 is a schematic diagram of the wireless sensor network 50, wherein the energy table or decision table of nodes S₁, S₂, S₃, and S₄ have been calculated. As shown in FIG. 4, the wireless sensor network 50 includes a root node S₀, an internal node S₁, and leaf nodes S₂˜S₄. Referring to FIG. 3, E₂[1] represents that the remaining energy of the node S₂ after it provides a sample is 85, E₂[2] represents that the remaining energy of the node S₂ after it provides 2 samples is 70, and so on. The decision table D₁ represents the optimal sampling rate allocation of the internal node S₁ and its child nodes S₂˜S₄. When the internal node S₁ needs to provides 3 samples to its parent node S₀, the optimal sampling rate allocation of the nodes S₁, S₂, S₃, and S₄ is (x₁,x₂,x₃,x₄)=(D₁[3,0],D₂[3,1],D₃ [3,2],D₄[3,3])=(1,1,0,1), and after the internal node S₁ provides the 3 samples, the critical energy among the nodes S₁, S₂, S₃, and S₄ is E₁[3]=80. Similarly, when the node S₁ needs to provide 2 samples to its parent node S₀, it can be understood based on the 2^(nd) row of the decision table D₁ that the optimal sampling rate allocation of the nodes S₁, S₂, S₃, and S₄ is (x₁,x₂,x₃,x₄)=(D₁[2,0],D₂[2,1],D₃ [2,2],D₄[2,3])=(1,1,0,0). After the node S₁ provides 2 samples, the critical energy among the nodes S₁, S₂, S₃, and S₄ is E₁[2]=85.

[Sampling Rate Allocation Method for Wireless Sensor Network]

FIG. 4 is the flowchart of the sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention. This method is suitable for a wireless sensor network in tree topology. As described above, the wireless sensor network in tree topology includes a root node, a plurality of internal nodes, and a plurality of leaf nodes.

First, in step S40, the root node S₀ broadcasts a total sample number R and the upper limits x_(u,1), x_(u,2), . . . , x_(u,n) and lower limits x_(l,1), x_(l,2), . . . , x_(l,n) of the sampling rates x₁, x₂, . . . , x_(n) of the nodes S₁, S₂, . . . , S_(n) to all the nodes S₁, S₂, . . . , S_(n). It should be noted that even though in the present embodiment, the sampling rates x₁, x₂, . . . , x_(n) have their upper limits x_(u,1), x_(u,2), . . . , x_(u,n) and lower limits x_(l,1), x_(l,2), . . . , x_(l,n), these upper limits and lower limits are not intended for limiting the scope of the present invention. In other words, the present invention may also be applied to an example without upper limit or lower limit. The example without upper limit or lower limit is only a special case of foregoing embodiment with the upper limits x_(u,1), x_(u,2), . . . , x_(u,n) as infinite and the lower limits x_(l,1), x_(l,2), . . . , x_(l,n) as 0.

Next, in step S41, a distributed computing method is adopted to allow each of the leaf nodes to perform local computation and upload the computation result to the internal node connected to the leaf node (i.e. the parent node of the leaf node). The parent node then sends the computation results of its child nodes to its parent node until all the computation results are sent to the root node S₀. As to the leaf nodes, foregoing computation results are the energy tables described above, and as to nodes other than the leaf nodes, these computation results include aforementioned energy tables and decision tables.

Finally, in step S42, the root node S₀ allocates the sampling rates of the child nodes of the root node and the numbers of samples to be uploaded to the root node S₀ from its child nodes according to the total number of samples and the computation result thereof so that the optimal sampling rates can be allocated to its child nodes. These child nodes further allocate the sampling rates of their child nodes and numbers of samples to be provided by their child nodes according to the computation results thereof and the numbers of samples to be uploaded to their parent nodes. As described above, the sampling rates are allocated to each level of nodes, and the process is completed when each of the leaf nodes are allocated with a sampling rate.

[Algorithm of Leaf Nodes]

FIG. 5 is a flowchart of a leaf node algorithm in a sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention. Referring to FIG. 5, in step S60, the leaf node S_(i) determines whether a total sample number R and the upper limit u_(,i) and lower limit l_(,i) of the sampling rate x_(i) are received from the root node S₀, wherein if the leaf node S_(i) does not receive the total number of samples R and the upper limit u_(,i) and lower limit l_(,i) of the sampling rate x_(i), the leaf node waits until it receives the total number of samples R and the upper limit u_(,i) and lower limit l_(,i) of the sampling rate x_(i) from the root node S₀; otherwise, step S61 is executed. In step S61, the leaf node S_(i) calculates and establishes its own energy table E_(i), wherein the energy table E_(i) has R+1 rows, each row has a field, the field of the 0^(th) row represents the original energy e_(i) of the leaf node S_(i), and the field E_(i)[j] of the j^(th) row (j>0) represents the remaining energy thereof after the leaf node S_(i) provides j samples, the computation thereof can be expressed as:

${E_{i}\lbrack j\rbrack} = \left\{ \begin{matrix} {{e_{i} - {\left( {\gamma_{i} + \alpha_{i,p}} \right)j}},} & {{{if}\mspace{14mu} j} \leq x_{u,i}} \\ {0,} & {others} \end{matrix} \right.$

wherein the node S_(p) represents the parent node of the leaf node S_(i). After the field of each row in the energy table E_(i) is calculated, the leaf node S_(i) sends the energy table E_(i) to its parent node S_(p). After that, in step S62, the leaf node S_(i) determines whether its parent node S_(p) allocates a sampling rate x_(i) for the leaf node S_(i), wherein if the parent node S_(p) allocates the sampling rate x_(i) for the leaf node S_(i), step S63 is then executed; otherwise, the leaf node S_(i) waits until its parent node S_(p) allocates the sampling rate x_(i) for it. In step S63, the parent node S_(p) allocates the sampling rate x_(i) for the leaf node S_(i), and the leaf node S_(i) senses samples according to the sampling rate allocated by its parent node S_(p).

It should be noted herein that even though in the present embodiment, the sampling rates x₁, x₂, . . . , x_(n) have their upper limits x_(u,1), x_(u,2), . . . , x_(u,n) and lower limits x_(l,1), x_(l,2), . . . , x_(l,n), these upper and lower limits are not intended for limiting the scope of the present invention. In other words, the present invention may also be applied in an example without upper or lower limit. The example without upper or lower limit is only a special case of foregoing embodiment with the upper limits x_(u,1), x_(u,2), . . . , x_(u,n) as infinite and the lower limits x_(l,1), x_(l,2), . . . , x_(l,n) as 0. Setting the upper limits x_(u,1), x_(u,2), . . . , x_(u,n) and the lower limits x_(l,1), x_(l,2), . . . , x_(l,n) of the sampling rates x₁, x₂, . . . , x_(n) is only to restrict the sampling rate of each node to be between its upper limit and lower limit, and by fairly setting the upper and lower limit of the sampling rate of each node, an good fairness can be achieved in the sampling rate allocation method and the wireless sensor network provided by the present invention. However, the sampling rate of each node may also have no upper or lower limit in the sampling rate allocation method and the wireless sensor network provided by the present invention.

[Algorithms of Internal Node and Root Node]

FIG. 6 is a flowchart of a root node algorithm or an internal node algorithm in a sampling rate allocation method for a wireless sensor network according to an embodiment of the present invention. Referring to FIG. 6, first, in step S70, the node S_(k) determines whether the energy tables of all its child nodes are received, wherein if the node S_(k) has received the energy tables of all its child nodes, step S71 is executed; otherwise, the node S_(k) waits until the energy tables of all its child nodes are received.

In step S71, the node S_(k) determines a source node for each sample starting from the 1^(st) sample to the R^(th) sample. The node S_(k) selects the node having the most remaining energy after the sample is provided as the source node of the sample. Taking the 1^(st) sample as an example, assuming that the node S_(k) has y child nodes, and E₁[1], E₂[1], E₃[1], . . . , E_(y)[1] are used for respectively denoting the remaining energy of the child nodes of the node S_(k) after a sample is provided. The node S_(k) selects the child node having the most remaining energy as the source node of the sample, namely, the source node is selected based on max{E₁[1],E₂[1],E₃[1], . . . ,E_(y)[1]}. For the convenience of description, the parameter δ_(i) is defined as the number of samples already provided by the child node S_(i) of the node S_(k), and δ_(i) is increased by 1 whenever the node S_(i) provides a sample.

When the child nodes of the internal node S_(k) have not provided any sample, δ_(i)=0, wherein i=1˜y. Then the values in the 0^(th) row of the decision table D_(k) are all 0, and if the j^(th) child node is selected as the source node of the 1^(st) sample, δ_(j) is increased by 1. Next, δ₁˜δ_(y) are sequentially filled into the 1^(st) row of the decision table D_(k), and accordingly D_(k)[1,j]=1 and D_(k)[1,i]=0, i≠j. Here the remaining energy of the j^(th) child node is E_(j)[1], and the remaining energies of the other child nodes S_(i) are still E_(i)[0] since they do not provide any sample. Thus, after the child nodes of the node S_(k) obtain a sample, the critical energy is E_(k)[1], E_(k)[1]=min{E₁[0],E₂[0],E₃[0], . . . ,E_(j)[1], . . . ,E_(y)[0]}. As described above, the source node of the m^(th) sample is selected based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}. If the j^(th) child node is selected again, then δ_(j)=δ_(j)+1, and the other δ_(i) having i≠j are not changed. The m^(th) row of the decision table D_(k) is respectively filled with each δ_(i), wherein i=1,2, . . . ,y, and thus each element of the m^(th) row is updated. Namely, D_(k)[m,i]=δ_(i). The critical energy herein is E_(k)[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}.

Since the sampling rate x_(i) of each child node S_(i) is allocated with a lower limit l_(,i), the lower limit l_(,i) of the sampling rate x_(i) should be sent to each child node S_(i) first, and then the samples are sequentially calculated starting from the

$\left( {\sum\limits_{i = 1}^{y}x_{l,i}} \right)^{th}$

sample to the last sample (i=R) through the method described above. By now, the decision table D_(k) and the energy table E_(k) are completed. After that, in step S72, determine whether the internal node S_(k) itself can sense to obtain samples. If the internal node S_(k) itself cannot sense any object, step S73 is then executed; otherwise, step S74 is executed. However, if the sampling rate has no upper or lower limit, then foregoing step of sequentially calculating the samples from the

$\left( {\sum\limits_{i = 1}^{y}x_{l,i}} \right)^{th}$

sample to the last sample (i=R) is changed to calculating from the 1^(st) sample to the last sample (i=R).

In the steps S73 and S74, the node S_(k) corrects the energy table E_(k) and the decision table D_(k) based on the affection of the energy thereof to the energy table E_(k) and the decision table D_(k). In step S74, the node S_(k) itself can take samples. Thus, the samples may come from the child nodes of the node S_(k) or from the node S_(k) itself. Here a virtual node S_(c) is used for representing all the child nodes of the node S_(k), and the energy table E_(c) and the decision table D_(c) of the virtual node S_(c) are respectively the energy table E_(k) and the decision table D_(k) obtained in step S71, namely, E_(c)=E_(k) and D_(c)=D_(k).

The node S_(k) determines whether each sample should be sensed by the node S_(k) itself or should be provided by the virtual node S_(c). Taking the 1^(st) sample as an example, the energy for sensing a sample and for sending a sample will be consumed if the node S_(k) senses the sample itself, namely, the remaining energy of the node S_(k) is e′_(k)=e_(k)−γ_(k)×1−α_(k,p)×1, wherein S_(p) represents the parent node of the node S_(k). Then the energy of the virtual node S_(c) will remain at E_(c)[0]. If the node S_(k) does not sense the sample itself but the sample is provided by the virtual node S_(c), the energy for receiving a sample and for sending a sample will be consumed, namely, the remaining energy of the node S_(k) is e′_(k)=e_(k)−β_(k)×1−α_(k,p)×1, and the energy of the virtual node S_(c) is reduced to E_(c)[1]. Next, foregoing two situations will be compared and the combination which allows the node S_(k) and the virtual node S_(c) to have the most remaining energy after a sample is provided is selected. If the node S_(k) is selected to provide the sample, then D_(k)[1,0]=1, D_(k)[1,1]=D_(k)[1,2]= . . . =D_(k)[1,y]=0, and E_(k)[1]=min{e_(k)−γ_(k)×1−α_(k,p)×1, E_(c)[0]}. Contrarily, if the virtual node S_(c) is selected to provide the sample, then D_(k)[1,0]=0, D_(k)[1,1]=D_(c)[1,1], D_(k)[1,2]=D_(c)[1,2], . . . , D_(k)[1,y]=D_(c)[1,y], and E_(k)[1]=min{e_(k)−β_(k)×1−α_(k,p)×1, E_(c)[1]}. As described above, every combination has to be checked when m samples are provided. In other words, all the situations from the node S_(k) providing 0 sample and the virtual node S_(c) providing m samples to the internal node S_(k) providing m samples and the virtual node S_(c) providing 0 samples should be checked. Thus, there are totally m+1 combinations to be checked. For example, if the node S_(k) provides w samples and the virtual node S_(c) provides (i−w) samples, the remaining energy of the node S_(k) is e′_(k)=e_(k)−γ_(k)×w−β_(k)×(m−w)−α_(k,p)×m, and the remaining energy of the virtual node S_(c) is E_(c)[m−w]. The combination among all of foregoing combinations which allows the critical energy to have the maximum value is selected, so as to complete step S74. Taking providing m samples as example, assuming the optimal combination is that the internal node S_(k) senses q samples and the virtual node S_(c) provides m−q samples, then there are D_(k)[m,0]=q in the 0^(th) field of the m^(th) row of the decision table D_(k) and D_(k)[m,1]=D_(k)[m−q,1], D_(k)[m,2]=D_(k)[m−q,2], . . . , D_(k)[m,y]=D_(k)[m−q,y] in the other fields of the m^(th) row, and the critical energy is E_(k)[m]=min{e_(k)−γ_(k)×a−β_(k)×(m−q)−α_(k,p)×m,E_(c)[m−q]}.

As described above, if it is determined in step S72 that the node S_(k) cannot sense samples itself, step S73 is then executed. In step S73, since the node S_(k) cannot sense samples, the 0^(th) field of every row of the decision table D_(k) is always 0, and accordingly, all the samples come from the child nodes of the node S_(k). The virtual node S_(c) is also used herein for representing all the child nodes of the node S_(k), and the energy table E_(k) and the decision table D_(k) obtained in step S72 are copied. Next, the energy table E_(k) is corrected as E_(k)=min{e_(k)−β_(k)×m−α_(k,p)×m,E_(c)[m]} (expression 1).

Step S75 is executed after step S74 or S73. In step S75, determine whether the node S_(k) is the root node. If the node S_(k) is the root node, then step S77 is executed; otherwise, the step S76 is executed.

If the internal node S_(k) is the root node S₀, in step S77, the root node S₀ allocates the number of samples to be provided by the child nodes of the root node S₀ according to the R^(th) row of the decision table D₀. In other words, assuming that the root node S₀ has y child nodes, then the root node S₀ notifies the values of D₀[R,1], D₀[R,2], . . . , D₀[R,y] respectively to its child nodes, and by now all the computations of the root node S₀ are completed.

If the node S_(k) is not the root node S₀, then in step S76, the node S_(k) send the energy table to its parent node S_(p). In step S78, the node S_(k) determines whether the number of samples to be provided by the node S_(k) is received from its parent node S_(p). If the node S_(k) has received the number of samples it should provide, then step S79 is executed; otherwise, the node S_(k) waits until it receives the number of samples to be provided by the node S_(k) from its parent node S_(p). In step S79, the node S_(k) looks up its decision table according to the number of samples allocated by its parent node S_(p), allocates its own sampling rate, and notifies its child nodes about the number of samples to be provided by these child nodes. This process goes on level by level so that the sampling rate of the node S_(k) in every level is allocated, and the nodes at the upper level of the leaf nodes determine the sampling rates of their leaf nodes and the sampling rates of themselves. Taking the node S_(k) as an example, assuming that the node S_(k) has y child nodes, if the parent node S_(p) notifies the node S_(k) that it should provide L samples. The node S_(k) then looks up its own decision table D_(k) according to the number L, the sampling rate thereof is D_(k)[L,0], and the numbers of samples to be provided by its child nodes are respectively D_(k)[L,1], D_(k)[L,2], . . . , D_(k)[L,y].

EXAMPLE 2

An example showing how to calculate and establish an energy table and a decision table and how to allocate a sampling rate by using the energy table and the decision table through the method described in foregoing embodiment will be described below. However, this example is not intended for limiting the scope of the present invention.

FIG. 7 is a schematic diagram of a wireless sensor network 80 in tree topology. The nodes S₂, S₃, S₄, S₅, S₆, and S₇ can sense samples automatically, while the nodes S₀ and S₁ cannot sense samples. The nodes S₂, S₃, S₄, S₆, and S₇ are leaf nodes, the nodes S₁ and S₅ are internal nodes, and the node S₀ is the root node.

FIG. 8 is a parameter table of the nodes S₀˜S₇ in FIG. 7. Referring to both FIG. 7 and FIG. 8, if it is assumed herein that the total number of samples has value R=3 and ρ=∞ (i.e. the lower limit of the sampling rate is 0 and the upper limit thereof is R), according to the method described in foregoing embodiment, the node S₀ broadcasts the total number of samples R required with a specific interval T and the upper limits x_(u,1), . . . , x_(u,7) and the lower limits x_(l,1), . . . , x_(l,7) of the sampling rates x₁, . . . , x₇ of the nodes S₁, . . . , S₇ to the entire network. Next, the leaf nodes S₂, S₃, S₄, S₆, and S₇ calculates their energy tables E₂, E₃, E₄, E₆, and E₇ after they receive the total number of samples R and the upper limits x_(u,1), . . . , x_(u,7) and the lower limits x_(l,1), . . . , x_(l,7) of the sampling rates x₁, . . . , x₇ from the node S₀. For example, E₂[1]=e₂−γ₂−α_(2,1)=150−10−20=120. After the leaf nodes S₂, S₃, S₄, S₆, and S₇ establish their energy tables E₂, E₃, E₄, E₆, and E₇, the leaf nodes S₂, S₃, and S₄ send the energy tables E₂, E₃, and E₄ to their parent node S₁, and the leaf nodes S₆ and S₇ sends the energy tables E₆ and E₇ to their parent node S₅. The nodes S₁ and S₅ calculate their energy tables E₁ and E₅ and decision tables D₁ and D₅ after they receive the energy tables from all of their child nodes. Taking the internal node S₁ as an example, the one having the maximum value among E₂[1], E₃[1], and E₄[1] is selected as the source node of the 1^(st) sample. Thus, the node S₂ is selected, and accordingly D₁[1,2]=1. The critical energy of the child nodes of the node S₁ after the 1^(st) sample is provided is E₁[1]=min{E₂[1],E₃[0],E₄[0]}=120. Taking the 2^(nd) sample as an example, the node S₁ selects the one having the maximum value among E₂[2], E₃[1], and E₄[1] as its source node. Thus, the node S₃ is selected and accordingly D₁[2,3]=1, and the numbers of samples to be provided by the leaf nodes S₂ and S₄ are not changed. Herein, the critical energy of the child nodes of the internal node S₁ after the 2^(nd) sample is provided is E₁[2]=min{E₂[1], E₃[1], E₄[0]}=120. Repeating the calculation as the described above, the energy table E₁ and the decision table D₁ of the node S₁ can be completed.

Thereafter, the energy table E₁ and the decision table D₁ are corrected according to whether the non-leaf node S₁ can automatically sense samples. In the present example, the virtual node S_(c) represents the child nodes S₂˜S₄ of the node S₁, wherein E_(c)=E₁ and D_(c)=D₁. Because the internal node S₁ cannot sense any sample, the values in the 0^(th) row of the decision table D₁ are all 0. Then, E₁[m]=min{e₁−β₁×m−α_(1,0)×m, E_(c)[m]} can be calculated as expression 1. After that, the energy table E₁ can be corrected. For example, E₁[1]=min{e₁−β₁×1−α_(1,0)×1,E_(c)[1]}=120, and the other E₁[m] can be calculated similarly. After the energy table E₁ is corrected, the node S₁ sends the energy table E₁ to the root node S₀.

Next, the energy table E₅ and the decision table D₅ are corrected according to whether the internal node S₅ can automatically sense samples. In the present example, the virtual node S_(c) represents all the child nodes S₆ and S₇ of the internal node S₅, wherein E_(c)=E₅ and D_(c)=D₅. Because the internal node S₅ can automatically sense samples, the internal node S₅ or the leaf node S₆ or S₇ may be the source node of each sample. FIG. 9 is a conceptual diagram illustrating the correction of the energy table E₅ and the decision table D₅. Referring to FIG. 9, taking providing 1 sample as an example, if the sample is provided by the internal node S₅, then the critical energy of the internal node S₅ and the virtual node S_(c) after providing the 1^(st) sample is min{e₅−γ₅×1−α_(5,0)×1,E_(c)[0]}=130; if the sample is provided by the virtual node S_(c), then the critical energy of the internal node S₅ and the virtual node S_(c) after providing the 1^(st) sample is min{e₅−β₅×1−α_(5,0)×1,E_(c)[1]}=125. Thereby, it can be understood from foregoing examples that the critical energy has a larger value when the node S₅ is selected to provide the sample, namely, D₅[1,0]=1, D₅[1,1]=0, D₅[1,2]=0.

Similarly, the internal node S₅ calculates through the same method when 2 samples are to be provided. In this case, there are three combinations. The first combination is that the node S₅ provides 0 sample, and the virtual node S_(c) provides 2 samples, wherein the critical energy is min{e₅−β₅×2−α_(5,0)×2,E_(c)[2]}=115. The second combination is that the node S₅ provides 1 sample, and the virtual node S_(c) provides 1 sample, wherein the critical energy is min{e₅−β₅×1−γ₅×1−α_(5,0)×2,E_(c)[1]}=110. The third combination is that the node S₅ provides 2 samples, and the virtual node S_(c) provides 0 sample, wherein the critical energy is min{e₅−γ₅×2−α_(5,0)×2,E_(c)[0]}=105. It can be understood from foregoing calculations that when 2 samples are to be provided, preferably the virtual node S_(c) is selected to provide the 2 samples. Herein, D₅[2,0]=0, D₅[2,1]=D_(c)[2,1], D₅[2,2]=D_(c)[2,2], and the critical energy is min{e₅−β₅×2−α_(5,0)×2,E_(c)[2]}=115. Foregoing method may also be applied when 3 samples are to be provided. After the energy table E₅ and the decision table D₅ are corrected, the node S₅ sends the energy table E₅ to the root node S₀.

The root node S₀ establishes the energy table E₀ and the decision table D₀ through the same method after it receives the energy tables E₁ and E₅. It can be understood based on the energy table E₀ and the decision table D₀ that when 3 samples are to be sensed within the specific interval T, preferably, the node S₁ is selected to provide 1 sample and the S₅ is selected to provide 2 samples. The root node S₀ notifies the result to the internal nodes S₁ and S₅. The internal node S₁ looks up the 1^(st) row in the decision table D₁ and understands that when 1 sample is to be provided, the leaf node S₂ should be selected to provide the sample. Similarly, the node S₅ looks up the 2^(nd) row in the decision table D₅ and understands that when 2 samples are to be provided, the leaf nodes S₆ should be selected to provide the 2 samples. Next, the internal nodes S₁ and S₅ respectively notify the optimal sampling rates to their child nodes S₂, S₃, S₄, S₆, and S₇, so as to complete the allocation of the sampling rates x₁, . . . , x₇ to the nodes S₁, S₂, . . . , S₇. In this example, the total number of samples R=3, the sampling rates of the nodes S₁˜S₇ are (x₁,x₂,x₃,x₄,x₅,x₆,x₇)=(0,1,0,0,0,2,0), and the critical energy is E₀[3]=115.

[Method for Implementing Upper Limits and Lower Limits of Sampling Rates]

As described above, the requirement of fairness is met. Generally speaking, a user can allocate the upper limits and the lower limits of the sampling rates by using an application program. Herein, two methods for allocating the upper limits and the lower limits of the sampling rates will be described. However, these two methods are only embodiments of the present invention but not intended for limiting the scope of the present invention.

The first method is a minimum mean deviation method. According to the minimum mean deviation method, the sampling rate of each node and the average sampling rate are restricted within a specific range ρ, wherein ρ can be set by the user. If the total number of samples is R and there are n nodes which can sense to obtain samples, then the average sampling rate is A=R/n, and accordingly the upper and lower limit of the sampling rate of each node which can sense are [A(1−ρ),A(1+ρ)]. For example, if ρ=10%, then the upper limit of the sampling rate of each node which can sense an object is A(1+10%), and the lower limit thereof is A(1−10%).

The second method is a weighting method. According to the weighting method, different weight is allocated to each node which can sense according to the physical position, the network position, or the sensing distance between the sensed object and the node. Assuming that W₁, W₂, . . . , W_(n) are the weights of the nodes S₁˜S_(n) which can sense object, wherein 0<W_(i)<1, W₁+W₂+ . . . +W_(n)=1, the upper limit and the lower limit of the sampling rate of the node S_(i) are [W_(i)*R(1−ρ), W_(i)*R(1+ρ)]. For example, R=100, ρ=10%, and W₁, W₂, W₃, W₄ are respectively 0.25, 0.25, 0.1, and 0.4, then the upper limits and the lower limits of the sampling rates of the nodes S₁˜S₄ are respectively [25(1−10%),25(1+10%)], [25(1−10%),25(1+10%)], [10(1−10%),10(1+10%)], and [40(1−10%),40(1+10%)].

EXAMPLE 3

The method for allocating sampling rates by using energy tables and decision tables in a wireless sensor network as described in foregoing embodiment will be described with reference to an example, wherein the sampling rates are allocated with upper limits and lower limits. However, this example is not intended for limiting the present invention.

FIG. 10 is a schematic diagram of a wireless sensor network 60 in tree topology. The nodes S₀, S₁, and S₂ have already establish their energy tables or decision tables through the method described above, and the sampling rates of the leaf nodes S₁ and S₂ are allocated with upper limits and lower limits. As shown in FIG. 10, assuming the total number of samples R=300 and the upper and lower limits of the sampling rates of the nodes S₁ and S₂ are respectively [40,160] and [50,150]. As described above, the energy table of the node S₀ records the remaining energy after the node S₀ receives (50+40)=90 samples to 300 samples.

In overview, the present invention provides a wireless sensor network and a sampling rate allocation method thereof. In the sampling rate allocation method, a distributed computing method is adopted so as to allow the wireless sensor network in tree topology to have a longer life time and meet the requirements to both total sample number and fairness. Moreover, since the wireless sensor network has a longer life time, the cost for replacing the batteries (for example, solar cells) of nodes and the volume of the batteries can be both reduced.

It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents. 

1. A wireless sensor network, comprising: a root node, for sending a total sample number to at least one internal node and a plurality of leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time; the leaf nodes, wherein each of the leaf nodes calculates the remaining energy after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the internal node; and the internal node, wherein the internal node generates a second calculation result and a third calculation result based on the first calculation results and uploads the second calculation result to the root node; wherein the root node generates a fourth calculation result and a fifth calculation result based on the second calculation result, then the root node determines the number of samples to be sent by the internal node to the root node within the specific time according to the fifth calculation result and the total number of samples, and finally, the internal node determines the number of samples to be sensed by the internal node and the leaf nodes within the specific time according to the number of samples to be sent by the internal node to the root node and the third calculation result.
 2. The wireless sensor network according to claim 1, wherein the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the internal node, and the fourth calculation result and the fifth calculation result are respectively an energy table and a decision table of the root node.
 3. The wireless sensor network according to claim 2, wherein the internal node calculates a temporary decision table and a temporary energy table according to the energy tables of the leaf nodes and then corrects the temporary decision table and the temporary energy table according to whether the internal node can automatically sense samples so as to generate the decision table and the energy table of the internal node, the decision table of the internal node records the mapping between the number of samples to be uploaded by the internal node to the root node within the specific time and the number of samples to be sensed by the internal node and the leaf nodes, and the decision table of the root node records the mapping between the total number of samples and the number of samples to be provided by the internal node to the root node.
 4. The wireless sensor network according to claim 2, wherein the root node further sends a maximum sampling rate and a minimum sampling rate of the internal node and a maximum sampling rate and a minimum sampling rate of each of the leaf nodes, the number of samples to be sensed by the internal node within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the internal node, and the number of samples to be sensed by each of the leaf nodes within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the leaf node.
 5. The wireless sensor network according to claim 4, wherein the maximum sampling rate and the minimum sampling rate of the internal node and the maximum sampling rate and the minimum sampling rate of each of the leaf nodes are determined through a minimum mean deviation method or a weighting method.
 6. A wireless sensor network, comprising: a root node, for sending a total sample number to a plurality of leaf nodes, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time; and the leaf nodes, wherein each of the leaf nodes calculates the remaining energy after providing a sample and generates a first calculation result, and the leaf node uploads the first calculation result to the root node; wherein the root node generates a second calculation result and a third calculation result based on the first calculation results, and then the root node determines the number of samples to be sensed by the leaf nodes within the specific time according to the third calculation result and the total number of samples.
 7. The wireless sensor network according to claim 6, wherein the first calculation results are energy tables of the leaf nodes, and the second calculation result and the third calculation result are respectively an energy table and a decision table of the root node.
 8. The wireless sensor network according to claim 7, wherein the decision table of the root node records the mapping between the total number of samples and the number of samples to be sensed by the leaf nodes.
 9. The wireless sensor network according to claim 7, wherein the root node further sends a maximum sampling rate and a minimum sampling rate of each of the leaf nodes, and the number of samples to be sensed by each of the leaf nodes within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the leaf node.
 10. The wireless sensor network according to claim 9, wherein the maximum sampling rate and the minimum sampling rate of each of the leaf nodes are determined through a minimum mean deviation method or a weighting method.
 11. A sampling rate allocation method, suitable for a wireless sensor network in tree topology, wherein the wireless sensor network comprises a root node and a plurality of leaf nodes, the sampling rate allocation method comprising: sending a total sample number to each of the leaf nodes by using the root node, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time; calculating the remaining energy of each of the leaf nodes after the leaf node provides a sample, generating a first calculation result, and uploading the first calculation result to the root node by using the leaf node; generating a second calculation result and a third calculation result based on the first calculation results by using the root node; and determining the number of samples to be sensed by the leaf nodes within the specific time according to the third calculation result and the total number of samples by using the root node.
 12. The sampling rate allocation method according to claim 11, wherein the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the root node, and the decision table of the root node records the mapping between the total number of samples and the number of samples to be sensed by the leaf nodes.
 13. The sampling rate allocation method according to claim 12, wherein the process executed by each of the leaf nodes comprises: determining whether a total sample number R is received from the root node S₀ by using the leaf node S_(i), wherein if the total number of samples R is not received, the leaf node S_(i) waits until the total number of samples R is received from the root node S₀; beginning to calculate and establish an energy table E_(i) of the leaf node S_(i) by using the leaf node S_(i), wherein the energy table E_(i) has R+1 rows, each of the rows has a field, the field of the 0^(th) row represents the original energy of the leaf node S_(i), and the field E_(i)[j] of the j^(th) row (j>0) represents the remaining energy after the leaf node S_(i) provides a j^(th) sample; sending the energy table E_(i) to the root node S₀ by using the leaf node S_(i) after the fields of all the rows in the energy table E_(i) are calculated; and determining whether the root node S₀ designates a number x_(i) of samples to be sensed by the leaf nodes within the specific time by using the leaf node S_(i), wherein if the root node S₀ designates the number x_(i), the leaf node S_(i) senses and captures samples according to the number x_(i) designated by the root node S₀; otherwise, the leaf node S_(i) waits until the root node S₀ designates the number x_(i).
 14. The sampling rate allocation method according to claim 12, wherein the process executed by the root node comprises: determining whether the energy tables sent by the leaf nodes are received by using the root node S₀, wherein if the root node S₀ does not receive the energy tables, the root node S₀ waits until the energy tables sent by the leaf nodes are received; determining a source node of each sample until the R^(th) sample by using the root node S₀, wherein the root node S₀ selects the leaf node S_(i) having the most remaining energy after the sample is provided as the source node of the sample, δ_(i) represents the number of samples already provided by the leaf node S_(i), δ_(i) is increased by 1 whenever the leaf node S_(i) provides a sample, δ_(i)=0 when the leaf node S_(i) provides no sample yet, wherein i=1˜y, then the values in the 0^(th) row of the decision table D₀ of the root node S₀ are all 0, the root node S₀ selects the source node of the m^(th) sample based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the leaf node S_(j) is selected, then δ_(j)=δ_(j)+1, the other δ_(i) having i≠j are not changed, the m^(th) row of the decision table D₀ of the root node S₀ are respectively filled with each δ_(k), k=1,2, . . . ,y, namely, D₀[m,k]=δ_(k), and the critical energy is E₀[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; and allocating the number of samples to be sensed by the leaf node S_(i) within the specific time according to the R^(th) row in the decision table D₀ by using the root node S₀.
 15. The sampling rate allocation method according to claim 12, wherein the root node further sends a maximum sampling rate and a minimum sampling rate of each of the leaf nodes, and the number of samples to be sensed by each of the leaf nodes within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the leaf node.
 16. The sampling rate allocation method according to claim 15, wherein the process executed by the root node comprises: determining whether the energy tables sent by the leaf nodes are received by using the root node S₀, wherein if the root node S₀ does not receive the energy tables, the root node S₀ waits until the energy tables sent by the leaf nodes are received; determining a source node of each sample starting from the $\left( {\sum\limits_{i = 1}^{y}x_{l,i}} \right)^{th}$ sample until the R^(th) sample by using the root node S₀, wherein l_(,i) represents the minimum sampling rate of the leaf node S_(i), and the number of samples to be provided by the leaf node S_(i) is up to the maximum sampling rate u_(,i) of the leaf node S_(i), the root node S₀ selects the leaf node S_(i) having the most remaining energy after the sample is provided as the source node of the sample, δ_(i) represents the number of samples already provided by the leaf node S_(i), δ_(i) is increased by 1 whenever the leaf node S_(i) provides a sample, δ_(i)=0 when the leaf node S_(i) provides no sample yet, wherein i=1˜y, then the values in the 0^(th) row of the decision table D₀ of the root node S₀ are all 0, the root node S₀ selects the source nodes of the m^(th) based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the leaf node S_(j) is selected, then δ_(j)=δ_(j)+1, the other δ_(i) having i≠j are not changed, the m^(th) row of the decision table D₀ of the root node S₀ are respectively filled with each δ_(k), k=1,2, . . . ,y, namely, D₀[m,k]=δ_(k), and the critical energy is E₀[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; and allocating the number of samples to be sensed by the leaf node S_(i) within the specific time according to the R^(th) row of the decision table D₀ by using the root node S₀.
 17. The sampling rate allocation method according to claim 16, wherein the maximum sampling rate and the minimum sampling rate of each of the leaf nodes are determined through a minimum mean deviation method or a weighting method.
 18. A sampling rate allocation method, suitable for a wireless sensor network in tree topology, wherein the wireless sensor network comprises a root node, at least one internal node, and a plurality of leaf nodes, the sampling rate allocation method comprising: sending a total sample number to the internal node and each of the leaf nodes by using the root node, wherein the total number of samples is the number of samples to be sensed by the wireless sensor network within a specific time; calculating the remaining energy of each of the leaf nodes after the leaf node provides a sample, generating a first calculation result, and uploading the first calculation result to the internal node by using each of the leaf nodes; generating a second calculation result and a third calculation result based on the first calculation results and uploading the second calculation result and the third calculation result to the root node by using the internal node; generating a fourth calculation result and a fifth calculation result based on the second calculation result by using the root node; determining the number of samples to be sent by the internal node to the root node within the specific time according to the fifth calculation result and the total number of samples by using the root node; and determining the number of samples to be sensed by the internal node and the leaf nodes within the specific time according to the number of samples to be sent by the internal node to the root node and the third calculation result by using the internal node.
 19. The sampling rate allocation method according to claim 18, wherein the first calculation results are energy tables of the leaf nodes, the second calculation result and the third calculation result are respectively an energy table and a decision table of the internal node, and the fourth calculation result and the fifth calculation result are respectively an energy table and a decision table of the root node, wherein the decision table of the root node records the mapping between the total number of samples and the number of samples to be provided by the internal node to the root node, and the decision table of the internal node records the mapping between the number of samples to be uploaded by the internal node to the root node within the specific time and the number of samples to be sensed by the internal node and the leaf nodes.
 20. The sampling rate allocation method according to claim 19, wherein the process executed by each of the leaf nodes comprises: determining whether the total number of samples R is received from the root node S₀ by using the leaf node S_(i), wherein if the total number of samples R is not received, the leaf node S_(i) waits until the total number of samples R is received from the root node S₀; beginning to calculate and establish an energy table E_(i) by using the leaf node S_(i), wherein the energy table E_(i) has R+1 rows, each of the rows has a field, the field of the 0^(th) row represents the original energy of the leaf node S_(i), and the field E_(i)[j] of the j^(th) row (j>0) represents the remaining energy after a j^(th) sample is provided; sending the energy table E_(i) to the internal node S_(k) by using the leaf node S_(i) after the fields of all the rows in the energy table E_(i) are calculated; and determining whether the internal node S_(k) designates the number x_(i) of samples to be sensed by the leaf nodes within the specific time by using leaf node S_(i), wherein if the internal node S_(k) designates the number x_(i), the leaf node S_(i) senses and obtains samples according to the number x_(i) designated by the internal node S_(k); otherwise, the leaf node S_(i) waits until the internal node S_(k) designates the number x_(i).
 21. The sampling rate allocation method according to claim 20, wherein the process executed by the internal node S_(k) comprises: determining whether the energy tables sent by all the leaf nodes are received by using the internal node S_(k), wherein if the energy tables are not received, the internal node S_(k) waits until the energy tables of all the leaf nodes are received; determining a source node for each sample until the R^(th) sample by using the internal node S_(k), wherein the internal node S_(k) selects the leaf node having the most remaining energy after the sample is provided as the source node of the sample, δ_(i) represents the number of sample already provided by the leaf node S_(i), δ_(i) is increased by 1 whenever the leaf node S_(i) provides a sample, δ_(i)=0 when the leaf node S_(i) provides no sample yet, wherein i=1˜y, then the values in the 0^(th) row of the decision table D_(k) of the internal node S_(k) are all 0, the internal node S_(k) determines the source node of the m^(th) sample based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the leaf node S_(j) is selected, then δ_(j)=δ_(j)+1, the other δ_(i) having i≠j are not changed, the m^(th) row of the decision table D_(k) of the root node are respectively filled with each δ_(i), i=1,2, . . . ,y, namely, D_(k)[m,i]=δ_(i), and the critical energy is E_(k)[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; determining whether the internal node S_(k) can take samples and accordingly correcting the energy table E_(k) or the decision table D_(k) of the root node by using the internal node S_(k); and uploading the energy table E_(k) and the decision table D_(k) to the root node S₀ by using the internal node S_(k); determining whether the number of samples to be provided by the internal node S_(k) to the root node S₀ in the specific time is received by using the internal node S_(k), wherein if the samples are not received, the internal node S_(k) waits until the number of samples to be provided by the internal node S_(k) to the root node S₀ in the specific time is received; and allocating the number of samples to be sensed by the leaf node S_(i) and the internal node S_(k) within the specific time by according to the u^(th) row in the decision table D_(k) by using the internal node S_(k), wherein u is the number of samples allocated by the root node to the internal node S_(k).
 22. The sampling rate allocation method according to claim 21, wherein the process executed by the root node comprises: determining whether the energy table sent by the internal node S_(k) is received by using the root node S₀, wherein if the energy table sent by the internal node S_(k) is not received, the root node S₀ waits until the energy table sent by the internal node S_(k) is received; determining a source node for each sample until the R^(th) sample by using the root node S₀, wherein the root node S₀ selects the internal node S_(k) having the most remaining energy after the sample is provided as the source node of the sample, δ_(k) represents the number of samples already provided by the internal node S_(k), δ_(k) is increased by 1 whenever the internal node S_(k) provides a sample, δ_(k)=0 when the internal node S_(k) provides no sample yet, wherein k=1˜y, then the values in the 0^(th) row of the decision table D₀ of the root node S₀ are all 0, the root node S₀ determines the source node of the m^(th) sample based on max{E₁[(δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the internal node S_(x) is selected, then δ_(x)=δ_(x)+1, the other δ_(k) having k≠x are not changed, the m^(th) row in the decision table D₀ of the root node S₀ are respectively filled with each δ_(k), k=1,2, . . . ,y, namely, D₀[m,k]=δ_(k), and the critical energy is E₀[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; and allocating the number of samples to be provided by the internal node S_(k) to the root node S₀ within the specific time according to the R^(th) row in the decision table D₀ by using the root node S₀.
 23. The sampling rate allocation method according to claim 22, wherein the step of determining whether the internal node S_(k) can take samples and accordingly correcting the energy table E_(k) or the decision table D_(k) of the internal node S_(k) by using the internal node S_(k) comprises: using a virtual node S_(c) to represent all the leaf nodes, the energy table E_(c) of the virtual node S_(c) is the energy table E_(k) of the internal node S_(k), the decision table D_(c) of the virtual node S_(c) is the energy table E_(k) of the internal node S_(k); determining whether each sample should be sensed by the internal node S_(k) or provided by the virtual node S_(c) by using the internal node S_(k) if the internal node S_(k) can take samples, wherein when m samples are provided, the internal node S_(k) providing 0 sample and the virtual node S_(c) providing m samples until the internal node S_(k) providing m samples and the virtual node S_(c) providing 0 sample have to be checked, and a combination which allows the critical energy to have the maximum value is selected, and the decision table D_(k) and the energy table E_(k) are then corrected according to the energy of the internal node S_(k); and setting the 0^(th) field in each row of the decision table D_(k) as 0 and correcting the energy table E_(k) according to the energy of the internal node S_(k) if the internal node S_(k) cannot sense and obtain samples.
 24. The sampling rate allocation method according to claim 19, wherein the root node further sends a maximum sampling rate and a minimum sampling rate of the internal node and a maximum sampling rate and a minimum sampling rate of each of the leaf nodes, the number of samples to be sensed by the internal node within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the internal node, and the number of samples to be sensed by each of the leaf nodes within the specific time has to be between the maximum sampling rate and the minimum sampling rate of the leaf node.
 25. The sampling rate allocation method according to claim 24, wherein the process executed by the internal node comprises: determining whether the energy tables sent by all the leaf nodes are received by using the internal node S_(k), wherein if the energy tables are not received, the internal node S_(k) waits until all the energy tables sent by all of the leaf nodes are received; determining a source node for each sample starting from the $\left( {\sum\limits_{i = 1}^{y}x_{l,i}} \right)^{th}$ sample to the R^(th) sample by using the internal node S_(k), wherein l_(,i) represents the minimum sampling rate of the leaf node S_(i), and the number of samples provided by the leaf node S_(i) is up to the maximum sampling rate u_(,i) of the leaf node S_(i), R represents the total number of samples, the internal node S_(k) selects the leaf node having the most remaining energy after the sample is provided as the source node of the sample, δ_(i) represents the number of samples already provided by the leaf node S_(i), δ_(i) is increased by 1 whenever the leaf node S_(i) provides a sample, δ_(i)=0 when the leaf node S_(i) provides no sample yet, wherein i=1˜y, then the values in the 0^(th) row of the decision table D_(k) of the internal node S_(k) are all 0, the internal node S_(k) determines the source node of the m^(th) sample based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the leaf node S_(j) is selected, then δ_(j)=δ_(j)+1, the other δ_(i) having i≠j are not changed, the m^(th) row in the decision table D_(k) of the root node are respectively filled with each δ_(i), i=1,2, . . . ,y, namely, D_(k)[m,i]=δ_(i), and the critical energy is E_(k)[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; determining whether the internal node S_(k) can take samples and accordingly correcting the energy table E_(k) or the decision table D_(k) of the internal node S_(k) by using the internal node S_(k); and uploading the energy table E_(k) and the decision table D_(k) to the root node S₀ by using the internal node S_(k); determining whether the number of samples to be provided by the internal node S_(k) to the root node S₀ in the specific time is received by using the internal node S_(k), wherein if the samples are not received, the internal node S_(k) waits until the number of samples to be provided by the internal node S_(k) to the root node S₀ in the specific time is received; and allocating the number of samples to be sensed by the leaf node S_(i) and the internal node S_(k) within the specific time according to the u^(th) row in the decision table D_(k) by using the internal node S_(k), wherein u is the number of samples allocated by the root node to the internal node S_(k).
 26. The sampling rate allocation method according to claim 25, wherein the process executed by the root node comprises: determining whether the energy table sent by the internal node S_(k) is received by using the root node S₀, wherein if the energy table is not received, the root node S₀ waits until the energy table sent by the internal node S_(k) is received; determining a source node for each sample from the $\left( {\sum\limits_{i = 1}^{y}x_{l,i}} \right)^{th}$ sample to the R^(th) sample by using the root node S₀, wherein x_(l,k) represents the minimum sampling rate of the internal node S_(k), and the number of samples provided by the internal node S_(k) is up to the maximum sampling rate of the internal node S_(k), the root node S₀ selects the internal node S_(k) having the most remaining energy after the sample is provided as the source node of the sample, δ_(k) represents the number of samples already provided by the internal node S_(k), δ_(k) is increased by 1 whenever the internal node S_(k) provides a sample, δ_(k)=0 when the internal node S_(k) provides no sample yet, wherein k=1˜y, then the values in the 0^(th) row of the decision table D₀ of the root node are all 0, the root node S₀ determines the source node of the m^(th) sample based on max{E₁[δ₁+1],E₂[δ₂+1],E₃[δ₃+1], . . . ,E_(y)[δ_(y)+1]}, if the internal node S_(x) is selected, then δ_(x)=δ_(x)+1, the other δ_(k) having k≠x are not changed, the m^(th) row in the decision table D₀ of the root node S₀ are respectively filled with each δ_(k), k=1,2, . . . ,y, namely, D₀[m,k]=δ_(k), and the critical energy is E₀[m]=min{E₁[δ₁],E₂[δ₂],E₃[δ₃], . . . ,E_(y)[δ_(y)]}; and allocating the number of samples to be provided by the internal node S_(k) to the root node S₀ within the specific time according to the R^(th) row in the decision table D₀ by using the root node S₀.
 27. The sampling rate allocation method according to claim 24, wherein the maximum sampling rate and the minimum sampling rate of the internal node and the maximum sampling rate and the minimum sampling of each of the leaf nodes are determined through a minimum mean deviation method or a weighting method. 